package top.frsf.card;

import top.frsf.GameObject;
import top.frsf.GamePanel;

import java.awt.*;
import java.time.Instant;

/**
 * @BelongsProject: MiniPZ
 * @BelongsPackage: top.frsf.card
 * @Author: FRSF
 * @CreateTime: 2022-09-08  23:29
 * @Description: 卡片父类
 * @Version: 1.0
 */
public class CardObject extends GameObject {
    final Image darkImage;
    final Image moveImage;
    final long CD;
    Instant click = Instant.now();
    public boolean isCD = false;
    public final int price;
    // 点击植物卡片后 拖拽植物图片 坐标
    public Point movePoint = null;

    public CardObject(String img, String darkImage, String moveImage, int x, int y, int width, int height, long cd, int price) {
        super(img, x, y, width, height);
        this.darkImage = GamePanel.tKit.getImage(darkImage);
        this.moveImage = GamePanel.tKit.getImage(moveImage);
        this.CD = cd;
        this.price = price;
    }

    // 启动计时器
    public void setClick(Instant click) {
        this.click = click;
    }
}
